package com.lichuang.dedao.user.enums;

import lombok.Getter;

@Getter
public enum Education {
    HIGHSCHOOL(0, "高中及以下"),
    JUNIORCOLLEGE(1, "专科"),
    UNDERGRADUATE(2, "本科"),
    POSTGRADUATE(3, "研究生"),
    DOCTOR(4, "博士及以上");

    private Integer value;
    private String name;

    Education(Integer value, String name){
        this.value = value;
        this.name = name;
    }

    public static Education EducationOf(Integer value){
        for (int i = 0; i < Education.values().length; i++) {
            if (Education.values()[i].value == value){
                return Education.values()[i];
            }
        }
        return null;
    }
}
